package nc.ui.tc.Monthlyadjustment.Adjust;

import nc.ui.pub.bill.BillItem;
import nc.ui.pub.bill.BillListPanel;

public class ShowItem {

	public static void showItem(BillListPanel billListPanel,String jobcode,String month)  {
		  String[] items = new String[] {  "summary", "contractno",
//				"borrowdate", 
				"repaymentdate",
					"yearinterestratio",
//					"addcapitalmoney",
//					"subcapitalmoney", 
					"loanbalances", 
//					"interest",
				"capitalmoney",

				"earlyloanbalances",

				"monthlyexplain"+month,
				"m"+month+"borrowdate",
				"m"+month+"repaymentdate",
				"m"+month+"addcapitalmoney",
				"m"+month+"subcapitalmoney",
				"m"+month+"interest",
				
//				
//				"m"+month+"loanbalances",
//				"m"+month+"interest"
				};
		
		BillItem[] billItems=billListPanel.getHeadBillModel().getBodyItems();
		for (int i = 0; i < billItems.length; i++) {
			billListPanel.hideHeadTableCol(billItems[i].getKey());
		}
		if("305030201".equals(jobcode))
		{
			billListPanel.showHeadTableCol("m"+month+"proxytaxrate");
		}
		
		for (int i = 0; i < items.length; i++) {
			billListPanel.showHeadTableCol(items[i]);
		}
	}
	
	public static void hiddenItem(BillListPanel billListPanel,String month,String jobcode)
	{
		 String[] items = new String[] {  "summary", "contractno",
//					"borrowdate", 
					"repaymentdate",
						"yearinterestratio",
//						"addcapitalmoney",
//						"subcapitalmoney", 
						"loanbalances", 
//						"interest",
					"capitalmoney",

					"earlyloanbalances",
//					"m"+month+"loanbalances",
//					"m"+month+"interest"
					};
		 for (int i = 0; i < items.length; i++) {
				billListPanel.hideHeadTableCol(items[i]);
			}
		 
		 for (int i = 1; i < 13; i++) {
			 billListPanel.hideHeadTableCol("monthlyexplain"+i);
			 billListPanel.hideHeadTableCol("m"+i+"borrowdate");
			 billListPanel.hideHeadTableCol("m"+i+"repaymentdate");
			 billListPanel.hideHeadTableCol("m"+i+"addcapitalmoney");
			 billListPanel.hideHeadTableCol("m"+i+"subcapitalmoney");
			 billListPanel.hideHeadTableCol("m"+i+"interest");
			 billListPanel.hideHeadTableCol("m"+i+"proxytaxrate");
		}
	}
}
